import 'package:flutter/material.dart';

import '../core/app_export.dart';

class DeleteConfirmationDialog extends StatelessWidget {
  final String playerName;
  final Function onConfirm;
  final String titleUser;

  const DeleteConfirmationDialog({super.key, required this.playerName, required this.onConfirm, required this.titleUser});

  @override
  Widget build(BuildContext context) {
    return AlertDialog(
      shadowColor: Colors.grey,
      elevation: 16,
      backgroundColor: Theme.of(context).colorScheme.secondary,
      title: const Text('تأكيد الحذف',style: TextStyle(color: Colors.red),),
      content: Text('هل أنت متأكد أنك ترغب في حذف $titleUser $playerName؟'),
      actions: <Widget>[
        TextButton(
          child: Text('إلغاء',style :theme.textTheme.titleMedium),
          onPressed: () {
            Navigator.of(context).pop();
          },
        ),
        TextButton(
          child: Text('تأكيد',style :theme.textTheme.titleMedium),
          onPressed: () {
            onConfirm();
            Navigator.of(context).pop();
          },
        ),
      ],
    );
  }
}